package com.xdcplus.web.mapper.trace;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xdcplus.web.common.pojo.entity.trace.TracePacketBatchInfo;
import com.xdcplus.web.common.pojo.vo.trace.PacketShortInfoVO;
import com.xdcplus.web.common.pojo.vo.trace.PacketTraceInfoVO;
import org.apache.ibatis.annotations.Param;

import java.sql.Timestamp;
import java.util.List;

/**
 * @author Devin.Sang
 */
public interface PacketTraceWashMapper extends BaseMapper<TracePacketBatchInfo> {


    Long getLastPacketId();


    List<PacketShortInfoVO> getPacketInfo(@Param(value = "lastPacketId") Long lastPacketId);

    @DS("doris")
    List<PacketTraceInfoVO> getTraceInfoByPacketCodes(@Param(value = "packetCodes") List<String> packetCodes,
                                                      @Param(value = "minTime") Timestamp minTime,
                                                      @Param(value = "maxTime") Timestamp maxTime);

    @DS("doris")
    List<PacketTraceInfoVO> getTraceInfoByToolCodes(@Param(value = "toolCodes") List<String> toolCodes,
                                                    @Param(value = "minTime") Timestamp minTime,
                                                    @Param(value = "maxTime") Timestamp maxTime);

    PacketTraceInfoVO getTraceInfoByCreatedTime(@Param(value = "startTime") String startTime,
                                                @Param(value = "endTime") String endTime,
                                                      @Param(value = "minTime") Timestamp minTime,
                                                      @Param(value = "maxTime") Timestamp maxTime);


    PacketTraceInfoVO getMeterialOrderByCreatedTime(@Param(value = "startTime") String startTime,
                                                    @Param(value = "endTime") String endTime,
                                                          @Param(value = "minTime") Timestamp minTime,
                                                          @Param(value = "maxTime") Timestamp maxTime);

    List<PacketShortInfoVO> getPacketInfoReversed(@Param(value = "lastPacketId") Long lastPacketId);



}
